import Vue from "vue";
import App from "./App.vue";
import "@/utils/esPolyfill.js";
import usePlugins from "./plugins";
import moment from "moment";
Vue.prototype.$moment = moment;
// import commonMixins from "@/mixins/common";
import SvgIcon from "@/components/svg-icon/SvgIcon";
Vue.component("SvgIcon", SvgIcon);
import DynamicTable from "@/components/dynamic-table";
Vue.component("DynamicTable", DynamicTable);
import sempty from "@/components/empty";
Vue.component("SEmpty", sempty);
// import sdescriptions from "@/components/descriptions";
// Vue.component("SDescriptions", sdescriptions);
import stooltip from "@/components/tooltip";
Vue.component("STooltip", stooltip);
// import destination from "@/components/destination";
// Vue.component("SDestination", destination);
// import destinationNa from "@/components/destinationNa";
// Vue.component("NDestination", destinationNa);
import batchTable from "@/components/batchTable";
Vue.component("SBatchTable", batchTable);
import CollapseTransition from "element-ui/lib/transitions/collapse-transition";
Vue.component(CollapseTransition.name, CollapseTransition);
import { message } from "@/utils/resetMessage";
//  按需引入element
import {
  Button,
  Select,
  Dialog,
  Form,
  Input,
  FormItem,
  Option,
  Loading,
  Message,
  Container,
  Card,
  Dropdown,
  DropdownMenu,
  DropdownItem,
  Row,
  Col,
  Menu,
  Submenu,
  MenuItem,
  Aside,
  Main,
  Badge,
  Header,
  Tabs,
  Breadcrumb,
  BreadcrumbItem,
  Scrollbar,
  Avatar,
  TabPane,
  Divider,
  Table,
  TableColumn,
  Cascader,
  Checkbox,
  CheckboxGroup,
  CheckboxButton,
  Pagination,
  Tag,
  Drawer,
  Tree,
  Popover,
  Switch,
  Collapse,
  CollapseItem,
  Tooltip,
  DatePicker,
  InputNumber,
  Steps,
  Step,
  Upload,
  Progress,
  MessageBox,
  Radio,
  RadioGroup,
  Calendar,
  timeline,
  timelineItem,
  Link,
  RadioButton,
  Popconfirm,
  CascaderPanel,
  Descriptions,
  DescriptionsItem,
  Empty,
  image,
  Autocomplete,
  // Popconfirm
} from "element-ui";
// collapse 展开折叠
Vue.use(Autocomplete);
Vue.use(RadioButton);
Vue.use(Popconfirm);
Vue.use(Descriptions);
Vue.use(DescriptionsItem);
Vue.use(CascaderPanel);
Vue.use(Button);
Vue.use(Select);
Vue.use(Dialog);
Vue.use(Form);
Vue.use(FormItem);
Vue.use(Input);
Vue.use(Option);
Vue.use(Container);
Vue.use(Card);
Vue.use(Dropdown);
Vue.use(DropdownMenu);
Vue.use(DropdownItem);
Vue.use(Row);
Vue.use(Col);
Vue.use(Menu);
Vue.use(Submenu);
Vue.use(MenuItem);
Vue.use(Aside);
Vue.use(Main);
Vue.use(Badge);
Vue.use(Header);
Vue.use(Tabs);
Vue.use(Breadcrumb);
Vue.use(BreadcrumbItem);
Vue.use(Avatar);
Vue.use(TabPane);
Vue.use(Divider);
Vue.use(Table);
Vue.use(TableColumn);
Vue.use(Checkbox);
Vue.use(Cascader);
Vue.use(Tag);
Vue.use(Pagination);
Vue.use(Drawer);
Vue.use(Tree);
Vue.use(CheckboxGroup);
Vue.use(CheckboxButton);
Vue.use(Popover);
Vue.use(InputNumber);
Vue.use(Switch);
Vue.use(Collapse);
Vue.use(CollapseItem);
Vue.use(Tooltip);
Vue.use(DatePicker);
Vue.use(Steps);
Vue.use(Step);
Vue.use(Upload);
Vue.use(Progress);
Vue.use(Radio);
Vue.use(RadioGroup);
Vue.use(Calendar);
Vue.use(Link);
// Vue.use(Popconfirm)
Vue.use(Scrollbar);
Vue.use(Loading.directive);
Vue.use(timeline);
Vue.use(timelineItem);
Vue.use(Empty);
Vue.use(image);
Vue.prototype.$loading = Loading.service;
// Vue.prototype.$message = Message;
Vue.prototype.$message = Message;
Vue.prototype.$confirm = MessageBox.confirm;
Dialog.props.closeOnClickModal.default = false;

// Vue.mixin(commonMixins);

Vue.use(usePlugins);
// 引入封装的router
import router from "@/router/index";





// time line css
import "../node_modules/timeline-vuejs/dist/timeline-vuejs.css";

import "@/permission"; 

Vue.config.productionTip = false;

// 路由守卫
import Bus from "@/utils/bus.js";
Vue.use(Bus);

import HappyScroll from "vue-happy-scroll";
// 引入css
import "vue-happy-scroll/docs/happy-scroll.css";
Vue.use(HappyScroll);

// directive 指令
import "@/directive";

import uploader from "vue-simple-uploader";
Vue.use(uploader);
// 引入echarts
// import * as echarts from 'echarts'
// Vue.prototype.$echarts = echarts
// 引入基本模板

console.log("当前版本号：" + require("../package.json").version);


import './main-prototype-api.js'
import './main-prototype.js'
import './main-components.js'
import './main-mixin.js'
import './mock'



import store from './store/index.js'
import dbl from "@/utils/dbl";
const userRouters=dbl.get("userRouters"); 
store.commit('SET_ROUTERS', userRouters); 
 



import VueStorage from "vue-ls";
Vue.use(VueStorage, {
  namespace: "szgljd__",
  name: "ls",
  storage: "local",
});

export default new Vue({
  render: (h) => h(App),
  router,
  store,
}).$mount("#app");
